<?php 
	//Change between light and dark theme
	//CSS name of light theme: default_light.css
	//CSS name of dark theme: default_dark.css

	if(isset($_POST['c_scheme'])){
		if($_SESSION['c_scheme'] == 'default_dark') $_SESSION['c_scheme'] = 'default_light'; 
		else{
			if($_POST['c_scheme'] == 'default_dark') $_SESSION['c_scheme'] = 'default_light';
			else $_SESSION['c_scheme'] = 'default_dark';
		}
	}
	
?>
<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<!--
======================================================================
Powered by DesignareThemes  //  www.drawpixels.com (free stuff soon!!)
======================================================================
-->
<head>
	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>">
	
	<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
	
	<?php if (is_search()) { ?>
	   <meta name="robots" content="noindex, nofollow" /> 
	<?php } ?>
	
	<meta name="keywords" content="architecture, business, portfolio, clean design, minimalist, themes, templates, wordpress, buy themes, jquery">

	<meta name="description" content="ARCHITEC is a Architecture Theme made by DesignareThemes.. it is clean and minimalist.">
	
	<link rel="shortcut icon" href="<?php echo get_option('arc_favicon'); ?>">

	<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/themes/default/default.css" media="screen">
	
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">

	<?php if ( is_singular() ) wp_enqueue_script('comment-reply'); ?>

	<?php wp_head(); ?>

	
	<!-- Google Maps Code -->
	
	<script type="text/javascript">
	  function initialize() {
	  	
		var latlng = new google.maps.LatLng(document.getElementById('gm_lat').value, document.getElementById('gm_lng').value);
		var myOptions = {
		  zoom: 15,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
		
		// Creating a marker and positioning it on the map
			var marker = new google.maps.Marker({
			  position: new google.maps.LatLng(document.getElementById('gm_lat').value, document.getElementById('gm_lng').value),
			  map: map
			});
	  }

	</script>
	<!-- END Google Maps Code -->
	<script type="text/javascript">
		$(document).ready(function(){
						
			$("a[rel^='prettyPhoto']").prettyPhoto({
				custom_markup: '<div id="map_canvas" style="width:1000px; height:500px"></div>',
				changepicturecallback: function(){ initialize(); $('#map_canvas').find('img').animate({
					'opacity':'1 !important',
					'filter':'alpha(opacity=100) !important'
				}); }
			});
		
			var title = "<?php echo get_the_title() ?>";
			title = title.toLowerCase();
			
			$('.menu-item a').each(function(i){
				var item_title = $(this).html();
				item_title = item_title.toLowerCase();
				if (title === item_title){
					if ($(this).parent().parent().hasClass('sub-menu')){
						$('.current-menu-ancestor a:first').addClass('selected');
					} else {
						$(this).addClass('selected');	
					}
				}
			});
			
			if($('#is_homepage').val() == "yes")
				$(".menu-item-home a:first").addClass('selected');	
			
		});
	</script>
	
	<script type="text/javascript">
		$(function(){
			$("#lightslide").click(function(){
				$("#lightslide").animate({marginLeft:'92px'},'slow');
			});
			
			$(".switchtheme").mouseleave(function(){
				 $("#lightslide").animate({marginLeft:'0'},'slow');
			});
		});
	</script>
	
</head>

<body <?php body_class(); the_tags(); ?>>

	<div id="templatedirectory" style="display:none; visibility:hidden; width: 0px; height: 0px; background: url(<?php echo get_template_directory_uri(); ?>/css/themes/default/loading.gif);"><?php echo get_template_directory_uri(); ?></div>
	
	<!-- start TopSlide -->
	<div id="topslide">
		<div id="panel">
			<div class="contactinfo">
				<div class="locationhello">
					<h4><span class="loc"><?php echo get_option('arc_topslider_title1'); ?></span></h4>
					<h4><span class="hel"><?php echo get_option('arc_topslider_title2'); ?></span></h4>
				</div>
			</div>
			<div class="architecinfo">
				<?php
					$comp_address = get_option('arc_company_address');
					if(!empty($comp_address)){
				?>
				<div class="art">
					<p><span class="titleinf">// <?php _e("Address"); ?></span></p>
					<p><?php echo get_option('arc_company_address'); ?></p>
				</div>
				<?php } ?>
				<?php				
					$comp_phone = get_option('arc_company_phone');
					if(!empty($comp_phone)){
				?>
				<div class="art">
					<p><span class="titleinf">// <?php _e("Phone"); ?></span></p>
					<p><?php echo get_option('arc_company_phone'); ?></p>
				</div>
				<?php } ?>
				<?php				
					$comp_fax = get_option('arc_company_fax');
					if(!empty($comp_fax)){
				?>
				<div class="art">
					<p><span class="titleinf">// <?php _e("Fax"); ?></span></p>
					<p><?php echo get_option('arc_company_fax'); ?></p>
				</div>
				<?php } ?>
				<?php				
					$comp_email = get_option('arc_company_email');
					$pers_email = get_option('arc_personal_email');
					if(!empty($comp_email) || !empty($pers_email)){
				?>				
				<div class="art">
					<p><span class="titleinf">// <?php _e("Email"); ?></span></p>
					<p>
					<?php				
						if(!empty($comp_email)){
					?>
					<a href="mailto:<?php echo get_option('arc_company_email'); ?>" class="maila"><?php echo get_option('arc_company_email'); ?></a><br>
					<?php } ?>
					<?php				
						if(!empty($pers_email)){
					?>
					<a href="mailto:<?php echo get_option('arc_personal_email'); ?>" class="maila"><?php echo get_option('arc_personal_email'); ?></a>
					<?php } ?>
					</p>
				</div>
				<?php } ?>
			</div>
			<div class="googlemap">
			<?php 
				$gm_coord = get_option('arc_company_location');
				if(!empty($gm_coord)){
			?>
				<div id="map">
					
					<a class="mapimg" href="#?custom=true&amp;width=1000&amp;height=500" rel="prettyPhoto"><img src="<?php
						$gm_latlng = explode(',', get_option('arc_company_location')); 
						$map_img = get_option('arc_map_default_image');
						if(!empty($map_img))
							echo $map_img;
						else{						
							echo "http://maps.googleapis.com/maps/api/staticmap?center=". $gm_latlng[0].",".$gm_latlng[1]."&zoom=12&size=392x222&sensor=false"; 
						}
					?>" alt="" class="mapimage"/></a>

				</div>
				<input type="hidden" id="gm_lat" value="<?php echo $gm_latlng[0]; ?>" />
					<input type="hidden" id="gm_lng" value="<?php echo $gm_latlng[1]; ?>" />
				<?php } ?>
			</div>
			<div class="linedivider"></div>
			<div class="contactform">
				<div id="message_success" class="form_success"></div>
				<form method="post" action="#" class="validateform">
					<ul class="form">
						<li>
							<input type="text" name="name" id="name" class="name" onfocus='$(this).val("");' onblur='if($(this).val() == "") $(this).val("<?php _e('Name'); ?>");' value="<?php _e('Name'); ?>">
							<div id="name_error" class="form_error"></div>
						</li>
						<li>
							<input type="text" name="email" id="email" class="email" onfocus='$(this).val("");' onblur='if($(this).val() == "") $(this).val("<?php _e('Email'); ?>");' value="<?php _e('Email'); ?>">
							<div id="email_error" class="form_error"></div>
						</li>
						<li>
							<input type="hidden" id="message_hidden" value="<?php echo get_option('arc_contactform_message_text'); ?>" />
							<textarea name="message" id="message" class="message" rows=50 cols=50 onfocus='$(this).html("");' onblur='if($(this).html() == "") $(this).html("<?php echo get_option('arc_contactform_message_text'); ?>");'><?php echo get_option('arc_contactform_message_text'); ?></textarea>
							<div id="message_error" class="form_error"></div>
						</li>
						<li>
							<a href="javascript:;" onclick="sendemail('<?php echo get_settings('admin_email'); ?>', '<?php echo get_option('arc_contactform_email_subject'); ?>', '<?php echo get_option('arc_contactform_name_error'); ?>', '<?php echo get_option('arc_contactform_email_error'); ?>', '<?php echo get_option('arc_contactform_message_error'); ?>')" class="button round_corners"><?php echo get_option('arc_contactform_button_text'); ?></a>
						</li>
					</ul>
				</form>
			</div>
		</div>	
	</div>
	
	<div id="top">
		<div class="btntopslide">
			<ul>
				<li id="toggle">
					<a id="open" class="open" href="#"></a>
					<a id="close" style="display: none;" class="close" href="#"></a>
				</li>
			</ul>	
		</div>
	</div>
	<!--end top slide-->
	
	<!-- start Header -->
		<div id="header">
			<?php
				$switcher = get_option('arc_color_switcher');

				if($switcher == 'true'){
			?>
			<div class="switchtheme">
				<form id="change_color_scheme_form" action="#" method="post">
					<a id="lightslide" class="lightslide" href="javascript:;"></a>
					<div class="lightpanel">
						<input type="text" id="c_scheme" name="c_scheme" value="<?php if(!empty($_SESSION['c_scheme'])) echo $_SESSION['c_scheme']; else echo get_option('arc_main_scheme'); ?>" style='display:none;' />
						<a href="javascript:;" class="lighton" onclick="$('#change_color_scheme_form').submit()"></a>
					</div>
				</form>
			</div>
			<?php } ?>

			<div class="header_c">
				<div id="logo"><a href="<?php echo home_url(); ?>"><?php
							if(!empty($_SESSION['c_scheme'])){ 
								if($_SESSION['c_scheme'] == 'default_dark') $logo = get_option('arc_sitelogo_dark'); else $logo = get_option('arc_sitelogo_light');
							} else {
								if(get_option('arc_main_scheme') == 'default_dark') $logo = get_option('arc_sitelogo_dark'); else $logo = get_option('arc_sitelogo_light');
							}
							if(!empty($logo)){
						?>
							<img src="<?php echo $logo; ?>" alt="<?php bloginfo('name'); ?>">
						<?php } ?>	
						</a></div>
				<div class="creditstheme">
					<p><?php bloginfo('description'); ?></p>
				</div>

				<div class="social_search">
					<div class="social">
						<?php
							$comp_twitter = get_option('arc_company_twitter');
							if(!empty($comp_twitter)){
						?>
						<a href="<?php echo get_option('arc_company_twitter'); ?>" target="_blank" class="twitter">twitter</a>
						<?php } ?>
						<?php
							$comp_facebook = get_option('arc_company_facebook');
							if(!empty($comp_facebook)){
						?>
						<a href="<?php echo get_option('arc_company_facebook'); ?>" target="_blank" class="facebook" title="Follow us on facebook">facebook</a>
						<?php } ?>

					</div>
					<?php
						$search_form = get_option('arc_search_form');
						if($search_form == 'true'){
					?>
					<div class="search">
						<ul>
							<li class="customSearchBar cSB-autohide" id="searchBar"> 
							<?php get_search_form(); ?> 
								
							</li>
						</ul>
					</div>
					<?php } ?>
				</div>
			</div>

		</div>
		<!-- end Header -->
		
		<!-- start Content -->
		<div id="wrapper">
			<div class="wrapper_c">
				<div class="stronglineleft"></div>

				<!-- start Menu -->
				<div id="menu" class="menu">
					<?php if(has_nav_menu('Primary Navigation')):
					echo '<ul id="menu-menu" class="menu">';
					if (function_exists('wp_nav_menu')) {	
					wp_nav_menu( array(
					 'container' =>true,
					 'container_class' => 'menu',
					 'container_id' => 'menu',
					 'theme_location' => 'Primary Navigation',
					 'sort_column' => 'menu_order')
					 );
					}
					?>
					<?php
						$contactUs = get_option('arc_contactus_option');
						if(!empty($contactUs)){
					?>
					<li class="togglec"><a href="#"><?php echo get_option('arc_contactus_option_text'); ?></a></li>
					<?php } ?>
					<?php
					echo '</ul>';
					endif;
					?>
				</div>
				<!-- end Menu -->
				
				